<template>
	<view>
		<view class="listItem " v-for="(item, index) in list" :key="index" @click="navtoDeails(item.mid || item.storyId)">
			<view class="flex flexBei">
				<view class="title textHd">
					<view class="iconfont inview icon-shuben">
					</view>
					{{item.name || item.medicalName}}
				</view>
				<view class="icons flex">
					<view class="iconItem">
						<view class="iconfont inview icon-liulan-copy"></view>
						<text>{{item.reading > 999 ? '999+' : item.reading}}</text>
					</view>
				</view>
			</view>	
				<view class="city">
					{{item.city}}
				</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"medical",
		props: {
			list : {
				type: Array,
				required: true,
				default() {
					return []
				}
			},
			id: {
				type: Number,
				required: true
			}
		},
		methods: {
			navtoDeails (id) {
				if (this.id == 0) {
					uni.navigateTo({
						url: `../history_details/history_details?id=${id}`
					})
				} else {
					uni.navigateTo({
						url: `../medical_details/medical_details?id=${id}`
					})
				}
				
			}
		}
	}
</script>

<style lang="scss">
.listItem {
	background-color: #fff;
	padding: 12rpx 24rpx;
	border-bottom: 1rpx solid #fafafa;
	.title {
		width: 460rpx;
		font-size: 32rpx;
		font-weight: bold;
		line-height: 72rpx;
		.iconfont {
			padding-right: 12rpx;
		}
	}
	.icons {
	  width: 140rpx;
	  font-size: 28rpx;
	  color: #999;
	  text-align: center;
	}
}
</style>
